﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EislaufScb.Model.Repository;
using EislaufScb.Model;
using System.IO;
using EislaufScb.Model.Repository.Organisation;

namespace EislaufScb.WebForms.Shared
{
    internal class PreDataLoad
    {
        private enum ClubTypeEnum
        {
            IceSkater,
            Hockey,
            Football
        }

        private enum RoleTypeEnum
        {
            Trainer,
            Monitor,
            President,
            Vizepresident,
            TechnicalChiefIceDance,
            Secretary,
            Cashier,
            TechnicalChiefIceSkating,
            Licencing,
            Judgment,
            Skater
        }

        private enum PhoneTypeEnum
        {
            Handy,
            Private,
            Business
        }

        private enum MemberTypeEnum
        {
            Active,
            Passive
        }

        private enum CategoryEnum
        {

        }

        private string[] professions = new string[] { "Dipl. Eislauftrainerin (schweiz. und amerikanisches Diplom)", 
                                                      "Dipl. Eislauftrainer (Körpererziehungs- und Sportfakultät Karls Universität in Prag, Spezialgebiet Eistanz und Choreographie)",
                                                      "Dipl. Eislauftrainerin mit Kernkompetenz in Choreographie", 
                                                      "Dipl. Eistanzlehrerin, SYS-Trainerin, Co-Trainerin Elite + Junioren + Nachwuchs", 
                                                      "Dipl. Eislauftrainerin (Eiskunstlauf und Paarlauf)", "Eiskunstlauf- und SYS- Trainerin",
                                                      "Damenschneiderin",
                                                      "Eislauflehrerin SELV seit 1995/96 (Kunstlauf, Laufstil und Synchronized Skating)",
                                                      "Jugend + Sport-Leiterin 3",
                                                      "Trainerin Leistungssport Swiss Olympic mit Eidg. Fachausweis",
                                                      "Div. Weiterbildungen bei J+S - Modulen, bei Swiss Olympic und an Preisrichter TS/TC - Kursen"};
        private string[] tests = new string[] { "Interbronze Kür SEV", "Intersilber SEV", "Intergold SEV", "Inter-Or ARP", "Test de Style Bronze", "Bronze Kür SEV",
                                                "Intergold", "3. Stern", "2. Stern", "1. Stern", "Bronze", "Intergold Kür SEV", "Gold", "Kür SEV", "Silber", "Interbronze Kür SEV", 
                                                "Kürtest Silber SEV", "Kürtest Silber EVBN", "Bronze Kür SEV", "Intersilber Kür SEV", "Interbronze", "Kürtest Intersilber SEV"};


        private string serverMapPath = string.Empty;

        public PreDataLoad()
        {
            ClubModelContainer container = new ClubModelContainer();
            BaseRepository repository = new BaseRepository(container);

            using (repository)
            {
                #region AddTypes
                AddPersonType(repository);
                AddPhoneTypes(repository);
                AddMemberType(repository);
                #endregion

                #region Add Skaters and theirs tests and personrolerelation
                Certifications(repository);
                AddSkaters(repository);
                #endregion

                #region AddContacts
                AddContacts(repository);
                AddAddresses(new PersonRepository(container));
                AddPhones(new PersonRepository(container));
                #endregion

                #region AddTrainers
                AddTrainers(new PersonRepository(container));
                #endregion
            }
        }

        private void AddTrainers(PersonRepository repository)
        {

            PersonType personType = new PersonType();
            personType.Name = "Trainer";
            repository.AddEntry<PersonType>(personType);
            repository.Save(personType);

            #region Jacqueline Kiefer
            if (repository.GetPersonByFirstNameAndLastName("Jacqueline", "Kiefer").Count == 0)
            {
                Person Kiefer = new Person();
                Kiefer.FirstName = "Jacqueline";
                Kiefer.LastName = "Kiefer";
                Kiefer.EMail = "kiefer.j@bluewin.ch";

                Kiefer.AdditionalTrainerData = new System.Data.Objects.DataClasses.EntityCollection<AdditionalTrainerData>();
                AdditionalTrainerData trainerData = new AdditionalTrainerData();
                trainerData.IsTrainerAt = "";
                trainerData.IsTrainerSince = "seit 1984";
                trainerData.Description = "Unterrichtet in der <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn PostFinance-Arena\">Posfinance Arena </a>";

                Kiefer.AdditionalTrainerData.Add(trainerData);

                Kiefer.Profession = new System.Data.Objects.DataClasses.EntityCollection<Profession>();
                Profession profession = new Profession();
                profession.Name = "Dipl. Eislauftrainerin (schweiz. und amerikanisches Diplom)";

                Kiefer.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Kiefer;
                Kiefer.PersonRoleRelation.Add(role);

                CurriculumViateEntry entryOne = new CurriculumViateEntry();
                entryOne.Title = "";
                entryOne.From = new DateTime(1982, 1, 1);
                entryOne.End = new DateTime(1984, 12, 31);
                entryOne.Description = "bis 1984 Trainerin in Grindelwald und Interlaken";
                Kiefer.CurriculumViateEntry.Add(entryOne);

                // Verbände Mitgliedschaften
                CurriculumViateEntry entryTwo = new CurriculumViateEntry();
                entryTwo.Title = "";
                entryTwo.From = new DateTime(1976, 1, 1);
                entryTwo.Description = "Mitglied beim SELV";
                Kiefer.CurriculumViateEntry.Add(entryTwo);

                CurriculumViateEntry entryThree = new CurriculumViateEntry();
                entryThree.Title = "";
                entryThree.From = new DateTime(1990, 1, 1);
                entryThree.Description = "Mitglied der technischen Kommission SELV";
                Kiefer.CurriculumViateEntry.Add(entryThree);

                CurriculumViateEntry entryFour = new CurriculumViateEntry();
                entryFour.Title = "";
                entryFour.From = new DateTime(2002, 1, 1);
                entryFour.Description = "Präsidentin der TK im SELV";
                Kiefer.CurriculumViateEntry.Add(entryFour);

                CurriculumViateEntry entryFive = new CurriculumViateEntry();
                entryFive.Title = "";
                entryFive.From = new DateTime(1998, 1, 1);
                entryFive.Description = "Vertreterin der Trainerkommission und Mitglied der Kommission Sport beim SEV";
                Kiefer.CurriculumViateEntry.Add(entryFive);

                string areaOfResponsibility = "Beratungstrainerin und Mitverantwortliche für die Trainerausbildung in der Schweiz <BR/> " +
                                              "Mitglied der Diplomprüfungskommission der SELV" + @"<BR />" +
                                              "Jugend + Sport Expertin und Dozentin an der Uni Bern <BR />" +
                                              "EPSA (European Professional Skating Coaches Assocation)<BR />" +
                                              "PSA (Proffesional Skaters Assocation of America) <BR />" +
                                              "VDT (Vereinigung Schweizer Diplomtrainer)";


                if (Kiefer.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Hinterbüelstrasse", Extension = "a", Number = 26 };
                    address.City = new City() { Name = "Wangen bei Olten", Postalcode = 4612 };
                    Kiefer.Address.Add(address);
                }

                Kiefer.AreaOfResponsibility = areaOfResponsibility;
                repository.AddEntry<Person>(Kiefer);
                repository.Save(Kiefer);
            }
            #endregion

            #region Fabian Vladminir
            if (repository.GetPersonByFirstNameAndLastName("Fabian", "Vladimir").Count == 0)
            {
                Person Vladimier = new Person();
                Vladimier.FirstName = "Fabian";
                Vladimier.LastName = "Vladimir";

                AdditionalTrainerData vladimirTrainerData = new AdditionalTrainerData();
                vladimirTrainerData.IsTrainerAt = "";
                vladimirTrainerData.IsTrainerSince = "seit 1990";
                vladimirTrainerData.Description = "Unterrichtet in der <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn%20Ka-We-De\">KA-WE-DE</a";

                Vladimier.AdditionalTrainerData.Add(vladimirTrainerData);

                Profession vladimirProfessionOne = new Profession();
                vladimirProfessionOne.Name = "Dipl. Eislauftrainer (Körperziehungs- und Sportfakultät Karls Universität in Prag, Spezialgebiet Eistanz und Choreographie)";

                Profession vladimirProfessionTwo = new Profession();
                vladimirProfessionTwo.Name = "Informatiker";

                Vladimier.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Vladimier;
                Vladimier.PersonRoleRelation.Add(role);

                Vladimier.Profession.Add(vladimirProfessionOne);
                Vladimier.Profession.Add(vladimirProfessionTwo);
                Vladimier.AdditionalTrainerData.Add(vladimirTrainerData);

                Vladimier.AreaOfResponsibility = "2-facher Juniorenmeiser der CSSR im Eistanzen <BR /> 2-facher Elitemeister der Slowakischen Republik im Eistanz <BR /> Mitglied des SELV";

                if (Vladimier.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Bachweg", Number = 65 };
                    address.City = new City() { Name = "Lättli", Postalcode = 3053 };
                    Vladimier.Address.Add(address);
                }

                if (Vladimier.Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 922 41 64" };
                    Vladimier.Phone.Add(phone);
                }

                repository.AddEntry<Person>(Vladimier);
                repository.Save(Vladimier);
            }
            #endregion

            #region Michèle Colberg
            if (repository.GetPersonByFirstNameAndLastName("Michèle", "Colberg").Count == 0)
            {
                Person Michele = new Person();
                Michele.FirstName = "Michèle";
                Michele.LastName = "Colberg";

                AdditionalTrainerData vladimirTrainerData = new AdditionalTrainerData();
                vladimirTrainerData.IsTrainerAt = "";
                vladimirTrainerData.IsTrainerSince = "seit 1987";
                vladimirTrainerData.Description = "Unterrichtet in der <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn PostFinance-Arena\">Postfinace Arena</a>";

                Michele.AdditionalTrainerData.Add(vladimirTrainerData);

                Profession MicheleProfessionOne = new Profession();
                MicheleProfessionOne.Name = "Dipl. Eislauftrainerin mit Kernkompetenz in Choreographie";

                Michele.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Michele;
                Michele.PersonRoleRelation.Add(role);

                Michele.Profession.Add(MicheleProfessionOne);
                Michele.AdditionalTrainerData.Add(vladimirTrainerData);

                Michele.AreaOfResponsibility = "Belgische Juniorenmeisterin <BR /> Wiener Eisrevue und Holiday on Ice als Solistin <BR /> Mitglied des SELV";

                if (Michele.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Hochbühlweg", Number = 1 };
                    address.City = new City() { Name = "Bern", Postalcode = 3012 };
                    Michele.Address.Add(address);
                }

                if (Michele.Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 351 16 18" };
                    Michele.Phone.Add(phone);
                }

                repository.AddEntry<Person>(Michele);
                repository.Save(Michele);
            }
            #endregion

            #region Zuzana Jarray
            if (repository.GetPersonByFirstNameAndLastName("Zuzana", "Jarray").Count == 0)
            {
                Person Zuzana = new Person();
                Zuzana.FirstName = "Zuzana";
                Zuzana.LastName = "Jarray";

                AdditionalTrainerData ZuzanaTrainerData = new AdditionalTrainerData();
                ZuzanaTrainerData.IsTrainerAt = "";
                ZuzanaTrainerData.IsTrainerSince = "seit 2000, Monitorin seit 1990";
                ZuzanaTrainerData.Description = "Unterrichtet in der <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn%20Ka-We-De\">KA-WE-DE</a>";

                Zuzana.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Zuzana;
                Zuzana.PersonRoleRelation.Add(role);

                Zuzana.AdditionalTrainerData.Add(ZuzanaTrainerData);

                Profession ZuzanaProfessionOne = new Profession();
                ZuzanaProfessionOne.Name = "Dipl. Eistanzlehrerin";

                Profession ZuzanaProfessioTwo = new Profession();
                ZuzanaProfessioTwo.Name = "SYS-Trainerin";

                Profession ZuzanaProfessionThree = new Profession();
                ZuzanaProfessionThree.Name = "Co-Trainerin Elite /Junioren /Nachwuchs";
                
                Zuzana.Profession.Add(ZuzanaProfessionOne);
                Zuzana.Profession.Add(ZuzanaProfessioTwo);
                Zuzana.Profession.Add(ZuzanaProfessionThree);

                Zuzana.AdditionalTrainerData.Add(ZuzanaTrainerData);

                Zuzana.AreaOfResponsibility = "3-fache Eistanz-Juniorenlandesmeisterin der Slowakei <BR />" +
                                              "2-fache Eistanz-Elitelandesmeisterin der Slowakei <BR />" +
                                              "Schweizer Eistanz-Vizemeisterin <BR />" +
                                              "Teilnahme an den Junioren EM und Elite-EM Eistanz" +
                                              "Teilnahme an den Junioren-WM und Elite-WM Eistanz" +
                                              "8. Rang Olympische Qualifikation Eistanz";

                if (Zuzana.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Bachweg", Number = 66 };
                    address.City = new City() { Name = "Lättli", Postalcode = 3053 };
                    Zuzana.Address.Add(address);
                }

                if (Zuzana.Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "079 456 68 72" };
                    Zuzana.Phone.Add(phone);
                }

                repository.AddEntry<Person>(Zuzana);
                repository.Save(Zuzana);
            }
            #endregion

            #region Heinz Wirz
            if (repository.GetPersonByFirstNameAndLastName("Heinz", "Wirz").Count == 0)
            {
                Person Heinz = new Person();
                Heinz.FirstName = "Heinz";
                Heinz.LastName = "Wirz";

                AdditionalTrainerData HeinzTrainerData = new AdditionalTrainerData();
                HeinzTrainerData.IsTrainerAt = "";
                HeinzTrainerData.IsTrainerSince = "seit 1975";
                HeinzTrainerData.Description = "Unterrichtet in der <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn PostFinance-Arena\">Postfinace Arena</a>";

                Heinz.AdditionalTrainerData.Add(HeinzTrainerData);

                Profession HeinzProfessionOne = new Profession();
                HeinzProfessionOne.Name = "Dipl. Eislauftrainer (Eiskunstlauf und Paarlauf)";

                Heinz.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Heinz;
                Heinz.PersonRoleRelation.Add(role);

                Heinz.Profession.Add(HeinzProfessionOne);
                Heinz.AdditionalTrainerData.Add(HeinzTrainerData);

                Heinz.AreaOfResponsibility = "Schweizermeiser im Paarlaufen, 5 Jahre Eisshows <BR />" +
                                               "18 Jahre Trainerausbildung in der Prüfungskommission <BR />" +
                                               "Mitglied des SELV <BR />" +
                                               "TK Präsident SELV während 6 Jahren <BR />" +
                                               "Experte Jugend + Sport, Dozent an der Uni Bern während 24 Jahren";

                CurriculumViateEntry HeinzEntryOne = new CurriculumViateEntry();
                HeinzEntryOne.From = new DateTime(1975, 1, 1);
                HeinzEntryOne.Title = "";
                HeinzEntryOne.Description = "Mitglied Diplomprüfungskommission des SELV";

                CurriculumViateEntry HeinzEntryTwo = new CurriculumViateEntry();
                HeinzEntryTwo.Title = "";
                HeinzEntryTwo.From = new DateTime(1978, 1, 1);
                HeinzEntryTwo.Description = "Vorstand SELV";

                Heinz.CurriculumViateEntry.Add(HeinzEntryOne);
                Heinz.CurriculumViateEntry.Add(HeinzEntryTwo);

                if (Heinz.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Greyerzerstrasse", Number = 79 };
                    address.City = new City() { Name = "Bern", Postalcode = 3013 };
                    Heinz.Address.Add(address);
                }

                if (Heinz.Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 332 58 61" };
                    Heinz.Phone.Add(phone);
                }

                repository.AddEntry<Person>(Heinz);
                repository.Save(Heinz);
            }
            #endregion

            #region Elena Bondarchuk
            if (repository.GetPersonByFirstNameAndLastName("Elena", "Bondarchuk").Count == 0)
            {
                Person Elena = new Person();
                Elena.FirstName = "Elena";
                Elena.LastName = "Bondarchuk";

                AdditionalTrainerData ElenaTrainerData = new AdditionalTrainerData();
                ElenaTrainerData.IsTrainerAt = "";
                ElenaTrainerData.IsTrainerSince = "";
                ElenaTrainerData.Description = "Unterrichtet in der <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn PostFinance-Arena\">Postfinace Arena</a> <BR />" +
                                               "und <a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn%20Ka-We-De\">KA-WE-DE</a>";

                Profession ElenaProfessionOne = new Profession();
                ElenaProfessionOne.Name = "Eiskunstlauf- und SYS- Trainerin";

                Elena.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Elena;
                Elena.PersonRoleRelation.Add(role);

                Elena.Profession.Add(ElenaProfessionOne);
                Elena.AdditionalTrainerData.Add(ElenaTrainerData);

                Elena.AreaOfResponsibility = "Aktive Läuferin beim ukrainischen Sportverein Dynamo-Kiew <BR />" +
                                               "Teilnahme an nationalen, sowjetischen und internationalen Wettkämpfen und nationalen sowie internationalen Schaulaufen <BR />" +
                                               "Ukrainische Vizemeisterin im Paarlauf <BR />" +
                                               "Mitglied der ukrainischen Nationalmannschaft im Eiskunstlauf (Junioren) <BR />" +
                                               "Mitglied des SELV";

                if (Elena.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Mitelweg", Number = 5 };
                    address.City = new City() { Name = "Burgdorf", Postalcode = 3400 };
                    Elena.Address.Add(address);
                }

                if (Elena.Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "079 205 10 29" };
                    Elena.Phone.Add(phone);
                }

                repository.AddEntry<Person>(Elena);
                repository.Save(Elena);
            }
            #endregion

            #region Caroline Kohler
            if (repository.GetPersonByFirstNameAndLastName("Caroline", "Kohler").Count == 0)
            {
                Person Caroline = new Person();
                Caroline.FirstName = "Caroline";
                Caroline.LastName = "Kohler";

                AdditionalTrainerData CarolineTrainerData = new AdditionalTrainerData();
                CarolineTrainerData.IsTrainerAt = "";
                CarolineTrainerData.IsTrainerSince = "seit 1975";
                CarolineTrainerData.Description = "Unterrichtet in der <a href=\"http://www.postfinancearena.ch/index.php?page=112\">Postfinace Arena</a> <BR />" +
                                               "<a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn%20Ka-We-De\">KA-WE-DE</a> und <BR />" +
                                               "<a href=\"http://www.sportamt-bern.ch/Sportanlagen/AnlageDetail/tabid/1651/Default.aspx?anlage=Kunsteisbahn Weyermannshaus\">KA-WE-DE</a>";

                Profession CarolineProfessionOne = new Profession();
                CarolineProfessionOne.Name = "Damenschneiderin";

                Profession CarolineProfessionTwo = new Profession();
                CarolineProfessionTwo.Name = "Eislauflehrerin SELV <BR /> (Kunstlauf, Laufstil und Synchronized Skating)";

                Profession CarolineProfessionThree = new Profession();
                CarolineProfessionThree.Name = "Jugend + Sport-Leiterin 3";

                Profession CarolineProfessionFour = new Profession();
                CarolineProfessionFour.Name = "Trainerin Leistungssport Swiss Olympic mit Eidg. Fachausweis";

                Profession CarolineProfessionFive = new Profession();
                CarolineProfessionFive.Name = "Div. Weiterbildungen bei J+S - Modulen, bei Swiss Olympic und an Preisrichter TS/TC - Kursen";

                Caroline.PersonRoleRelation = new System.Data.Objects.DataClasses.EntityCollection<PersonRoleRelation>();
                PersonRoleRelation role = new PersonRoleRelation();
                role.PersonType = repository.GetAll<PersonType>().Where(type => type.Name == "Trainer").ToList().First();
                role.Person = Caroline;
                Caroline.PersonRoleRelation.Add(role);

                Caroline.Profession.Add(CarolineProfessionOne);
                Caroline.Profession.Add(CarolineProfessionTwo);
                Caroline.Profession.Add(CarolineProfessionThree);
                Caroline.Profession.Add(CarolineProfessionFour);
                Caroline.Profession.Add(CarolineProfessionFive);

                CurriculumViateEntry one = new CurriculumViateEntry();
                one.Title = "";
                one.Description = "aktive Läuferin beim EC Burgdorf(Kunstlauf und Synchronized Skating)";
                one.From = new DateTime(1976, 1, 1);
                one.End = new DateTime(1996, 12, 31);

                CurriculumViateEntry two = new CurriculumViateEntry();
                two.Title = "";
                two.Description = "Preisrichterin";
                two.From = new DateTime(1985, 1, 1);
                two.End = new DateTime(1995, 12, 31);

                Caroline.CurriculumViateEntry.Add(one);
                Caroline.CurriculumViateEntry.Add(two);

                Caroline.AdditionalTrainerData.Add(CarolineTrainerData);

                Caroline.AreaOfResponsibility = "Teilnahme an internationalen Wettkämpfen mit dem Team Cool Dreams Senior <BR />" +
                                               "1993/94/96 Vize-Schweizermeisterin und 1995 Schweizermeisterin mit dem Team Cool Dreams Senior <BR />" +
                                               "11. Rang mit den Cool Dreams Junior am World Challange Cup <BR />" +
                                               "Vize – Schweizermeister mit den Cool Dreams Novice <BR />" +
                                               "2. Rang mit den Cool Dreams Novice am Swiss Cup" +
                                               "Swiss Cup – Sieger mit den Cool Dreams Juvenile (Kat. Juv.)" +
                                               "Sieger der Biasca - Trophy mit den Cool Dreams Juvenile (Kat. Juv.)";

                if (Caroline.Address.Count == 0)
                {
                    Address address = new Address();
                    address.Street = new Street() { Name = "Hasenmattstrasse", Number = 36 };
                    address.City = new City() { Name = "Langenthal", Postalcode = 4900 };
                    Caroline.Address.Add(address);
                }

                if (Caroline.Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "079 620 79 39" };
                    Phone phoneHome = new Phone() { SubScriberNumber = "062 923 01 75" };
                    Caroline.Phone.Add(phone);
                    Caroline.Phone.Add(phoneHome);
                }

                repository.AddEntry<Person>(Caroline);
                repository.Save(Caroline);
            }
            #endregion
        }

        private void AddAddresses(PersonRepository repository)
        {
            Person staempfli = repository.GetPersonByFirstNameAndLastName("Christoph", "Stämpfli").FirstOrDefault();
            if (staempfli != null && staempfli.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Saanegässli", Number = 14, Extension = "" };
                address.City = new City() { Postalcode = 3205, Name = "Gümmenen" };

                staempfli.Address.Add(address);
                repository.Save(staempfli);
            }

            Person Burkhardt = repository.GetPersonByFirstNameAndLastName("Jürg", "Burkhardt").FirstOrDefault();
            if (Burkhardt != null && Burkhardt.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Blütenweg", Number = 4, Extension = "" };
                address.City = new City() { Postalcode = 4102, Name = "Binningen" };

                Burkhardt.Address.Add(address);
                repository.Save(Burkhardt);
            }

            Person Minder = repository.GetPersonByFirstNameAndLastName("Walter", "Minder").FirstOrDefault();
            if (Minder != null && Minder.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Gässli", Number = 1, Extension = "" };
                address.City = new City() { Postalcode = 3264, Name = "Diesbach" };

                Minder.Address.Add(address);
                repository.Save(Minder);
            }

            Person Bossi = repository.GetPersonByFirstNameAndLastName("Cécile", "Bossi").FirstOrDefault();
            if (Bossi != null && Bossi.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Bolligenstrasse", Number = 48, Extension = "A" };
                address.City = new City() { Postalcode = 3006, Name = "Bern" };

                Bossi.Address.Add(address);
                repository.Save(Bossi);
            }

            Person Willi = repository.GetPersonByFirstNameAndLastName("Brigitta", "Willi").FirstOrDefault();
            if (Willi != null && Willi.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Jungfraustrasse", Number = 20, Extension = "" };
                address.City = new City() { Postalcode = 3076, Name = "Worb" };

                Willi.Address.Add(address);
                repository.Save(Willi);
            }

            Person Ostertag = repository.GetPersonByFirstNameAndLastName("Marie", "Ostertag").FirstOrDefault();
            if (Ostertag != null && Ostertag.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Kirchstrasse", Number = 130, Extension = "" };
                address.City = new City() { Postalcode = 3084, Name = "Wabern" };

                Ostertag.Address.Add(address);
                repository.Save(Ostertag);
            }

            Person Wernli = repository.GetPersonByFirstNameAndLastName("Renata", "Wernli").FirstOrDefault();
            if (Wernli != null && Wernli.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Ahornweg", Number = 6, Extension = "" };
                address.City = new City() { Postalcode = 3122, Name = "Kehrsatz" };

                Wernli.Address.Add(address);
                repository.Save(Wernli);
            }

            Person Jähnig = repository.GetPersonByFirstNameAndLastName("Catrin", "Jähnig").FirstOrDefault();
            if (Jähnig != null && Jähnig.Address.Count == 0)
            {
                Address address = new Address();
                address.Street = new Street() { Name = "Ballenbühlweg", Number = 6, Extension = "" };
                address.City = new City() { Postalcode = 3076, Name = "Worb" };

                Jähnig.Address.Add(address);
                repository.Save(Jähnig);
            }
        }

        private void Certifications(BaseRepository repository)
        {
            if (repository.GetAll<Certification>().Count == 0)
            {
                for (int index = 0; index < tests.Length; index++)
                {
                    Certification certification = new Certification();
                    certification.Description = tests[index];

                    repository.AddEntry<Certification>(certification);
                    repository.Save(certification);
                }
            }
        }

        private void AddSkaters(BaseRepository repository)
        {

            if (repository.GetAll<PersonRoleRelation>().Where(role => role.PersonType.Name.Contains("Skater")).ToList().Count > 0)
            {
                return;
            }

            #region Julie Husi
            Person julie = new Person();
            julie.FirstName = "Julie";
            julie.LastName = "Husi";
            julie.DateOfBirth = new DateTime(2001, 5, 18);
            julie.TrainedBy = "Jacqueline Kiefer und Michèle Colberg";

            Certification julieCertification = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze")).FirstOrDefault();
            julie.Test.Add(julieCertification);

            PersonRoleRelation julieRole = new PersonRoleRelation();
            julieRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            julieRole.Person = julie;

            repository.AddEntry<PersonRoleRelation>(julieRole);
            repository.Save(julieRole);

            #endregion

            #region Nicole Maurer
            Person nicole = new Person();
            nicole.FirstName = "Nicole";
            nicole.LastName = "Maurer";
            nicole.DateOfBirth = new DateTime(2000, 12, 20);
            nicole.TrainedBy = "Jacqueline Kiefer und Michèle Colberg";

            Certification nicoleCertification = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze")).FirstOrDefault();
            nicole.Test.Add(nicoleCertification);

            PersonRoleRelation nicoleRole = new PersonRoleRelation();
            nicoleRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            nicoleRole.Person = nicole;

            repository.AddEntry<PersonRoleRelation>(nicoleRole);
            repository.Save(nicoleRole);
            #endregion

            #region Manuela Ostertag
            Person manuela = new Person();
            manuela.FirstName = "Manuela";
            manuela.LastName = "Ostertag";
            manuela.DateOfBirth = new DateTime(1986, 6, 28);
            manuela.TrainedBy = "Heinz Wirz und Michèle Colberg";

            Certification manuelaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kürtest Intersilber SEV")).FirstOrDefault();
            Certification manuelaCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kürtest Silber EVBN")).FirstOrDefault();
            manuela.Test.Add(manuelaCertificationOne);
            manuela.Test.Add(manuelaCertificationTwo);

            PersonRoleRelation manuelaRole = new PersonRoleRelation();
            manuelaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            manuelaRole.Person = manuela;

            repository.AddEntry<PersonRoleRelation>(manuelaRole);
            repository.Save(manuelaRole);
            #endregion

            #region Nathalie Stämpfli
            Person Nathalie = new Person();
            Nathalie.FirstName = "Nathalie";
            Nathalie.LastName = "Stämpfli";
            Nathalie.DateOfBirth = new DateTime(1994, 4, 28);
            Nathalie.TrainedBy = "Heinz Wirz und Michèle Colberg";

            Certification nathalieCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intergold")).FirstOrDefault();
            Certification nathalieCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kür SEV")).FirstOrDefault();
            Nathalie.Test.Add(nathalieCertificationOne);
            Nathalie.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation NathalieRole = new PersonRoleRelation();
            NathalieRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            NathalieRole.Person = Nathalie;

            repository.AddEntry<PersonRoleRelation>(NathalieRole);
            repository.Save(NathalieRole);
            #endregion

            #region Vanessa Spahr
            Person Vanessa = new Person();
            Vanessa.FirstName = "Vanessa";
            Vanessa.LastName = "Spahr";
            Vanessa.DateOfBirth = new DateTime(1994, 4, 28);
            Vanessa.TrainedBy = "Jacqueline Kiefer und Michèle Colberg";

            Certification VanessaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze Kür SEV")).FirstOrDefault();
            Vanessa.Test.Add(nathalieCertificationOne);

            PersonRoleRelation VanessaRole = new PersonRoleRelation();
            VanessaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            VanessaRole.Person = Vanessa;

            repository.AddEntry<PersonRoleRelation>(VanessaRole);
            repository.Save(VanessaRole);
            #endregion

            #region Carmelo Tedesco
            Person Carmelo = new Person();
            Carmelo.FirstName = "Carmelo";
            Carmelo.LastName = "Tedesco";
            Carmelo.DateOfBirth = new DateTime(1995, 2, 11);
            Carmelo.TrainedBy = "Jacqueline Kiefer";

            Certification CarmeloCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze Kür SEV")).FirstOrDefault();
            Carmelo.Test.Add(nathalieCertificationOne);
            Certification CarmeloCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze Kür SEV")).FirstOrDefault();
            Carmelo.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation CarmeloRole = new PersonRoleRelation();
            CarmeloRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            CarmeloRole.Person = Carmelo;

            repository.AddEntry<PersonRoleRelation>(CarmeloRole);
            repository.Save(CarmeloRole);
            #endregion

            #region Amra Dubravcevic
            Person Amra = new Person();
            Amra.FirstName = "Amra";
            Amra.LastName = "Dubravcevic";
            Amra.DateOfBirth = new DateTime(2001, 2, 23);
            Amra.TrainedBy = "Jacqueline Kiefer und Michèle Colberg";

            Certification AmraCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze")).FirstOrDefault();
            Amra.Test.Add(nathalieCertificationOne);

            PersonRoleRelation AmraRole = new PersonRoleRelation();
            AmraRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            AmraRole.Person = Amra;

            repository.AddEntry<PersonRoleRelation>(AmraRole);
            repository.Save(AmraRole);
            #endregion

            #region Aldana Schneider
            Person Aldana = new Person();
            Aldana.FirstName = "Aldana";
            Aldana.LastName = "Schneider";
            Aldana.DateOfBirth = new DateTime(1996, 11, 17);
            Aldana.TrainedBy = "Jacqueline Kiefer und Michèle Colberg";

            Certification AldanaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intersilber Kür SEV")).FirstOrDefault();
            Aldana.Test.Add(nathalieCertificationOne);
            Certification AldanaCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze Kür SEV")).FirstOrDefault();
            Aldana.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation AldanaRole = new PersonRoleRelation();
            AldanaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            AldanaRole.Person = Aldana;

            repository.AddEntry<PersonRoleRelation>(AldanaRole);
            repository.Save(AldanaRole);
            #endregion

            #region Christina Kurasheva
            Person Christina = new Person();
            Christina.FirstName = "Christina";
            Christina.LastName = "Kurasheva";
            Christina.DateOfBirth = new DateTime(1997, 8, 22);
            Christina.TrainedBy = "Jacqueline Kiefer";

            Certification ChristinaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze Kür SEV")).FirstOrDefault();
            Christina.Test.Add(nathalieCertificationOne);

            PersonRoleRelation ChristinaRole = new PersonRoleRelation();
            ChristinaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            ChristinaRole.Person = Christina;

            repository.AddEntry<PersonRoleRelation>(ChristinaRole);
            repository.Save(ChristinaRole);
            #endregion

            #region Sara Krähenbühl
            Person Sara = new Person();
            Sara.FirstName = "Sara";
            Sara.LastName = "Krähenbühl";

            Certification SaraCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze")).FirstOrDefault();
            Sara.Test.Add(nathalieCertificationOne);

            PersonRoleRelation SaraRole = new PersonRoleRelation();
            SaraRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            SaraRole.Person = Sara;

            repository.AddEntry<PersonRoleRelation>(SaraRole);
            repository.Save(SaraRole);
            #endregion

            #region Ilario Tedesco
            Person Ilario = new Person();
            Ilario.FirstName = "Ilario";
            Ilario.LastName = "Tedesco";
            Ilario.DateOfBirth = new DateTime(1998, 6, 18);
            Ilario.TrainedBy = "Jacqueline Kiefer";

            Certification IlarioCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intersilber Kür SEV")).FirstOrDefault();
            Ilario.Test.Add(nathalieCertificationOne);

            PersonRoleRelation IlarioRole = new PersonRoleRelation();
            IlarioRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            IlarioRole.Person = Ilario;

            repository.AddEntry<PersonRoleRelation>(IlarioRole);
            repository.Save(IlarioRole);
            #endregion

            #region Linda Rhyn
            Person Linda = new Person();
            Linda.FirstName = "Linda";
            Linda.LastName = "Rhyn";
            Linda.DateOfBirth = new DateTime(1996, 9, 2);
            Linda.TrainedBy = "Heinz Wirz und Michèle Colberg";

            Certification LindaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze Kür SEV")).FirstOrDefault();
            Linda.Test.Add(nathalieCertificationOne);

            PersonRoleRelation LindaRole = new PersonRoleRelation();
            LindaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            LindaRole.Person = Linda;

            repository.AddEntry<PersonRoleRelation>(LindaRole);
            repository.Save(LindaRole);
            #endregion

            #region Sandra Willi
            Person Sandra = new Person();
            Sandra.FirstName = "Sandra";
            Sandra.LastName = "Willi";
            Sandra.DateOfBirth = new DateTime(1998, 1, 8);
            Sandra.TrainedBy = "Jaueline Kiefer";

            Certification SandraCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze Kür SEV")).FirstOrDefault();
            Sandra.Test.Add(nathalieCertificationOne);

            Certification SandraCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intersilber Kür SEV")).FirstOrDefault();
            Sandra.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation SandraRole = new PersonRoleRelation();
            SandraRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            SandraRole.Person = Sandra;

            repository.AddEntry<PersonRoleRelation>(SandraRole);
            repository.Save(SandraRole);
            #endregion

            #region Fabiène Tröhler
            Person Fabienne = new Person();
            Fabienne.FirstName = "Fabiène";
            Fabienne.LastName = "Tröhler";
            Fabienne.DateOfBirth = new DateTime(1986, 10, 25);
            Fabienne.TrainedBy = "Jaueline Kiefer";

            Certification FabienneCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kürtest Silber SEV")).FirstOrDefault();
            Fabienne.Test.Add(nathalieCertificationOne);

            Certification FabienneCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kürtest Silber EVBN")).FirstOrDefault();
            Fabienne.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation FabienneRole = new PersonRoleRelation();
            FabienneRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            FabienneRole.Person = Fabienne;

            repository.AddEntry<PersonRoleRelation>(FabienneRole);
            repository.Save(FabienneRole);
            #endregion

            #region Rina Havasy
            Person Rina = new Person();
            Rina.FirstName = "Rina";
            Rina.LastName = "Havasy";
            Rina.DateOfBirth = new DateTime(1997, 12, 15);
            Rina.TrainedBy = "Jaueline Kiefer und Michèle Colberg (Choreographie)";

            Certification RinaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze")).FirstOrDefault();
            Rina.Test.Add(nathalieCertificationOne);

            PersonRoleRelation RinaRole = new PersonRoleRelation();
            RinaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            RinaRole.Person = Rina;

            repository.AddEntry<PersonRoleRelation>(RinaRole);
            repository.Save(RinaRole);
            #endregion

            #region Audrey Aebi
            Person Audrey = new Person();
            Audrey.FirstName = "Audrey";
            Audrey.MiddleName = "Estelle";
            Audrey.LastName = "Aebi";
            Audrey.DateOfBirth = new DateTime(1999, 12, 25);
            Audrey.TrainedBy = "Jaueline Kiefer und Michèle Colberg (Choreographie)";

            Certification AudreyCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze")).FirstOrDefault();
            Audrey.Test.Add(nathalieCertificationOne);

            PersonRoleRelation AudreyRole = new PersonRoleRelation();
            AudreyRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            AudreyRole.Person = Audrey;

            repository.AddEntry<PersonRoleRelation>(AudreyRole);
            repository.Save(AudreyRole);
            #endregion

            #region Ronya Tamborini
            Person Ronya = new Person();
            Ronya.FirstName = "Ronya";
            Ronya.LastName = "Tamborini";
            Ronya.DateOfBirth = new DateTime(1997, 3, 23);
            Ronya.TrainedBy = "Michèle Colberg und Heinz Wirz";

            Certification RonyaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze")).FirstOrDefault();
            Ronya.Test.Add(nathalieCertificationOne);

            PersonRoleRelation RonyaRole = new PersonRoleRelation();
            RonyaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            RonyaRole.Person = Ronya;

            repository.AddEntry<PersonRoleRelation>(RonyaRole);
            repository.Save(RonyaRole);
            #endregion

            #region Christoph Jähnig
            Person Christoph = new Person();
            Christoph.FirstName = "Christoph";
            Christoph.LastName = "Jähnig";
            Christoph.DateOfBirth = new DateTime(1996, 8, 3);
            Christoph.TrainedBy = "Heinz Wirz und Michèle Colberg";

            Certification ChristophCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze")).FirstOrDefault();
            Christoph.Test.Add(nathalieCertificationOne);

            Certification ChristophCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kür SEV")).FirstOrDefault();
            Christoph.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation ChristophRole = new PersonRoleRelation();
            ChristophRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            ChristophRole.Person = Christoph;

            repository.AddEntry<PersonRoleRelation>(ChristophRole);
            repository.Save(ChristophRole);
            #endregion

            #region Dalila Ramazani
            Person Dalila = new Person();
            Dalila.FirstName = "Dalila";
            Dalila.LastName = "Ramazani";
            Dalila.DateOfBirth = new DateTime(1990, 7, 4);
            Dalila.TrainedBy = "Jaueline Kiefer und Michèle Colberg";

            Certification DalilaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Silber")).FirstOrDefault();
            Dalila.Test.Add(nathalieCertificationOne);

            Certification DalilaCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kür SEV")).FirstOrDefault();
            Dalila.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation DalilaRole = new PersonRoleRelation();
            DalilaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            DalilaRole.Person = Dalila;

            repository.AddEntry<PersonRoleRelation>(DalilaRole);
            repository.Save(DalilaRole);
            #endregion

            #region Anastassia Kistler
            Person Anastassia = new Person();
            Anastassia.FirstName = "Anastassia ";
            Anastassia.LastName = "Kistler";

            Certification AnastassiaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Gold")).FirstOrDefault();
            Anastassia.Test.Add(nathalieCertificationOne);

            Certification AnastassiaCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Kür SEV")).FirstOrDefault();
            Anastassia.Test.Add(nathalieCertificationTwo);

            PersonRoleRelation AnastassiaRole = new PersonRoleRelation();
            AnastassiaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            AnastassiaRole.Person = Anastassia;

            repository.AddEntry<PersonRoleRelation>(AnastassiaRole);
            repository.Save(AnastassiaRole);
            #endregion

            #region Jessica Rudolf von Rohr
            Person Jessica = new Person();
            Jessica.FirstName = "Jessica ";
            Jessica.LastName = "Rudolf von Rohr";
            Jessica.DateOfBirth = new DateTime(1994, 12, 8);
            Jessica.TrainedBy = "Jaueline Kiefer und Michèle Colberg";

            Certification JessicaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intergold Kür SEV")).FirstOrDefault();
            Jessica.Test.Add(nathalieCertificationOne);

            PersonRoleRelation JessicaRole = new PersonRoleRelation();
            JessicaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            JessicaRole.Person = Jessica;

            repository.AddEntry<PersonRoleRelation>(JessicaRole);
            repository.Save(JessicaRole);
            #endregion

            #region Raphael Röthlisberger
            Person Raphael = new Person();
            Raphael.FirstName = "Raphael ";
            Raphael.LastName = "Röthlisberger";
            Raphael.DateOfBirth = new DateTime(1990, 11, 3);
            Raphael.TrainedBy = "Jaueline Kiefer und Michèle Colberg";

            Certification RaphaelCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze")).FirstOrDefault();
            Raphael.Test.Add(nathalieCertificationOne);

            PersonRoleRelation RaphaelRole = new PersonRoleRelation();
            RaphaelRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            RaphaelRole.Person = Raphael;

            repository.AddEntry<PersonRoleRelation>(RaphaelRole);
            repository.Save(RaphaelRole);
            #endregion

            #region Raphael Gerber
            Person RaphaelG = new Person();
            RaphaelG.FirstName = "Raphael ";
            RaphaelG.LastName = "Gerber";
            RaphaelG.DateOfBirth = new DateTime(2001, 9, 20);
            RaphaelG.TrainedBy = "Jaueline Kiefer und Michèle Colberg";

            Certification RaphaelGCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("3. Stern")).FirstOrDefault();
            RaphaelG.Test.Add(nathalieCertificationOne);

            PersonRoleRelation RaphaelGRole = new PersonRoleRelation();
            RaphaelGRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            RaphaelGRole.Person = RaphaelG;

            repository.AddEntry<PersonRoleRelation>(RaphaelGRole);
            repository.Save(RaphaelGRole);
            #endregion

            #region Océane Seppey
            Person Oceane = new Person();
            Oceane.FirstName = "Océane ";
            Oceane.LastName = "Seppey";
            Oceane.TrainedBy = "Jaueline Kiefer und Michèle Colberg";

            Certification OceaneCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intergold")).FirstOrDefault();
            Oceane.Test.Add(nathalieCertificationOne);

            PersonRoleRelation OceaneRole = new PersonRoleRelation();
            OceaneRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            OceaneRole.Person = Oceane;

            repository.AddEntry<PersonRoleRelation>(OceaneRole);
            repository.Save(OceaneRole);
            #endregion

            #region Vanessa Boppart
            Person VanessaB = new Person();
            VanessaB.FirstName = "Vanessa ";
            VanessaB.LastName = "Boppart";
            VanessaB.DateOfBirth = new DateTime(2001, 2, 3);
            VanessaB.TrainedBy = "Jaueline Kiefer";

            Certification VanessaBCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Bronze Kür SEV")).FirstOrDefault();
            VanessaB.Test.Add(VanessaBCertificationOne);

            PersonRoleRelation VanessaBRole = new PersonRoleRelation();
            VanessaBRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            VanessaBRole.Person = VanessaB;

            repository.AddEntry<PersonRoleRelation>(VanessaBRole);
            repository.Save(VanessaBRole);
            #endregion

            #region Vincent Cuérel
            Person Vincent = new Person();
            Vincent.FirstName = "Vincent";
            Vincent.LastName = "Cuérel";
            Vincent.DateOfBirth = new DateTime(1996, 4, 25);
            Vincent.TrainedBy = "Jacqueline Kiefer, Madame Thomet und Michèle Colberg";

            Certification VincentCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intergold SEV")).FirstOrDefault();
            Vincent.Test.Add(VincentCertificationOne);

            Certification VincentCertificationTwo = repository.GetAll<Certification>().Where(c => c.Description.Equals("Inter-Or ARP")).FirstOrDefault();
            Vincent.Test.Add(VincentCertificationTwo);

            Certification VincentCertificationThree = repository.GetAll<Certification>().Where(c => c.Description.Equals("Test de Style Bronze")).FirstOrDefault();
            Vincent.Test.Add(VincentCertificationThree);

            PersonRoleRelation VincentRole = new PersonRoleRelation();
            VincentRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            VincentRole.Person = Vincent;

            repository.AddEntry<PersonRoleRelation>(VincentRole);
            repository.Save(VincentRole);
            #endregion

            #region Salome Kohler
            Person Salome = new Person();
            Salome.FirstName = "Salome";
            Salome.LastName = "Kohler";
            Salome.DateOfBirth = new DateTime(2000, 3, 21);

            Certification SalomeCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Interbronze Kür SEV")).FirstOrDefault();
            Salome.Test.Add(SalomeCertificationOne);

            PersonRoleRelation SalomeRole = new PersonRoleRelation();
            SalomeRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            SalomeRole.Person = Salome;

            repository.AddEntry<PersonRoleRelation>(SalomeRole);
            repository.Save(SalomeRole);
            #endregion

            #region Micha Kohler
            Person Micha = new Person();
            Micha.FirstName = "Micha";
            Micha.LastName = "Steffen";
            Micha.DateOfBirth = new DateTime(2000, 3, 21);
            Micha.TrainedBy = "Hein Wirz, Franziska Gautschi, Franziska Steffen";

            Certification MichaCertificationOne = repository.GetAll<Certification>().Where(c => c.Description.Equals("Intersilber SEV")).FirstOrDefault();
            Micha.Test.Add(MichaCertificationOne);

            PersonRoleRelation MichaRole = new PersonRoleRelation();
            MichaRole.PersonType = repository.GetAll<PersonType>().Where(role => role.Name.Contains(RoleTypeEnum.Skater.ToString())).FirstOrDefault();
            MichaRole.Person = Micha;

            repository.AddEntry<PersonRoleRelation>(MichaRole);
            repository.Save(MichaRole);
            #endregion
        }

        private void AddPhoneTypes(BaseRepository repository)
        {
            List<string> phoneTypes = Enum.GetNames(typeof(PhoneTypeEnum)).ToList();

            if (repository.GetAll<PhoneType>().ToList().Count > 0)
                return;

            for (int index = 0; index < phoneTypes.Count; index++)
            {
                PhoneType phoneType = new PhoneType() { Name = phoneTypes[index] };
                repository.AddEntry<PhoneType>(phoneType);
                repository.Save(phoneType);
            }
        }

        private void AddPersonType(BaseRepository repository)
        {
            List<string> phoneTypes = Enum.GetNames(typeof(RoleTypeEnum)).ToList();

            if (repository.GetAll<PersonType>().ToList().Count > 0)
                return;

            for (int index = 0; index < phoneTypes.Count; index++)
            {
                PersonType phoneType = new PersonType() { Name = phoneTypes[index] };
                repository.AddEntry<PersonType>(phoneType);
                repository.Save(phoneType);
            }
        }

        private void AddCategoryType()
        {


        }

        private void AddClubType(BaseRepository repository)
        {

        }

        private void AddInfrastructureType()
        {

        }

        private void AddProfession(BaseRepository repository)
        {
            if (repository.GetAll<Profession>().ToList().Count > 0)
                return;

            for (int index = 0; index < professions.Count(); index++)
            {
                Profession profession = new Profession() { Name = professions[index] };
                repository.AddEntry<Profession>(profession);
                repository.Save(profession);
            }
        }

        private void AddMemberType(BaseRepository repository)
        {
            List<string> memberTypes = Enum.GetNames(typeof(MemberTypeEnum)).ToList();

            if (repository.GetAll<MemberType>().ToList().Count > 0)
                return;

            for (int index = 0; index < memberTypes.Count; index++)
            {
                MemberType memberType = new MemberType() { Name = memberTypes[index] };
                repository.AddEntry<MemberType>(memberType);
                repository.Save(memberType);
            }
        }

        private void AddClubAndBlogAndOlderEntries(BaseRepository repository)
        {
            Club club = new Club();
            Blog blog = new Blog();
            blog.Name = "News";

            club.Blog.Add(blog);
            club.FoundingYear = new DateTime(1920, 1, 1);
            club.History = "Ganz viele Gschichten";
            club.Name = "EislaufSCB";
            club.Url = "http://www.eislaufscb.ch";
            club.Type = ClubTypeEnum.IceSkater.ToString();

            string bOneEntry = string.Format("leider haben sich Fehler eingeschlichen: {0} {1} 1. Seite 26, der Mitgliederbeitrag für Junioren beträgt SFr. 195.-- (nicht SFr. 165.--) {2}" +
                                                                                               "2. Seite 31, der Kurs 108 findet freitags von 16.15 Uhr bis 17.00 Uhr statt (nicht mittwochs 16.30 Uhr) {3}" +
                                                                                               "3. Seite 33, Richtigstellung: Frau Monika Kohli ist kein Vostandsmitglied{4}" +
                                                                                               "4. Seite 26, Richtigstellung: Clubmitglieder erhalten keinen Preisnachlass von SFr. 100.-- für Kurse. {5} Dieser Preisnachlass wird nur Nichtmitglieder welche neu in den Club eingetreten sind gegeben",
                                                                                               Environment.NewLine,
                                                                                               Environment.NewLine,
                                                                                               Environment.NewLine,
                                                                                               Environment.NewLine,
                                                                                               Environment.NewLine,
                                                                                               Environment.NewLine);

            BlogEntry bOne = new BlogEntry() { CreateDate = new DateTime(2010, 11, 3), Title = "Der Schlöfler", Content = bOneEntry };
            BlogEntry bTwo = new BlogEntry()
            {
                CreateDate = new DateTime(2011, 1, 1),
                Title = "Fotoalben per 2011",
                Content = string.Format("http://picasaweb.google.com/102054500668536152104 {0}" +
                                        "Viel Spass beim Herunterladen, Bearbeiten, Weiterleiten usw.", Environment.NewLine)
            };

            BlogEntry bThree = new BlogEntry() { PublishingDate = new DateTime(2011, 2, 4), Title = "Off-Ice Training mit Chris Muri in der Zwischensaison", Content = "Flyer herunterladen" };
            BlogEntry bFour = new BlogEntry() { PublishingDate = new DateTime(2011, 3, 6), Title = "Sommerlager Flims und Grindelwald", Content = "Der Club organisiert für in Grindelwald und Flims keine Lager und keine Unterkünfte. Unsere Trainerinnen und Trainer organisieren die Sommertrainings wie gewohnt auf privater Basis und ohne Unterstützung des Clubs." };
            BlogEntry bFive = new BlogEntry() { PublishingDate = new DateTime(2011, 4, 28), Title = "Homerpage", Content = "Am 15. April 2011 habe ich diese Webseite Herrn Daniel Schädler übergeben. Vielen Dank für die Kenntnisnahme Roland Schneider" };

            blog.BlogEntry.Add(bOne);
            blog.BlogEntry.Add(bTwo);
            blog.BlogEntry.Add(bThree);
            blog.BlogEntry.Add(bFour);
            blog.BlogEntry.Add(bFive);

            repository.AddEntry<Blog>(blog);
            repository.Save(club);
        }

        private void AddContacts(BaseRepository repository)
        {
            if (repository.GetAll<Person>().Where(person => person.PersonRoleRelation.FirstOrDefault().PersonType.Name != "Skater" && person.PersonRoleRelation.FirstOrDefault().PersonType.Name != "Trainer").ToList().Count == 0)
            {
                #region Christop Stämpfli
                Person christoph = new Person();
                christoph.FirstName = "Christoph";
                christoph.LastName = "Stämpfli";
                christoph.EMail = "ch_a.staempfli@hispeed.ch";

                PersonRoleRelation christophRelation = new PersonRoleRelation();
                christophRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.President.ToString())).FirstOrDefault();
                christophRelation.Person = christoph;
                christoph.AreaOfResponsibility = "Präsidentschaft";

                repository.AddEntry<PersonRoleRelation>(christophRelation);
                repository.Save(christophRelation);
                #endregion

                #region Jürg Burkhardt
                Person juerg = new Person();
                juerg.FirstName = "Jürg";
                juerg.LastName = "Burkhardt";
                juerg.EMail = "";

                PersonRoleRelation juergRelation = new PersonRoleRelation();
                juergRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.Vizepresident.ToString())).FirstOrDefault();
                juergRelation.Person = juerg;
                juerg.AreaOfResponsibility = "";

                repository.AddEntry<PersonRoleRelation>(juergRelation);
                repository.Save(juergRelation);
                #endregion

                #region Walter Minder
                Person walter = new Person();
                walter.FirstName = "Walter";
                walter.LastName = "Minder";
                walter.EMail = "walter.minder@hin.ch";

                PersonRoleRelation walterRelation = new PersonRoleRelation();
                walterRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.TechnicalChiefIceDance.ToString())).FirstOrDefault();
                walterRelation.Person = walter;
                walter.AreaOfResponsibility = "TK-Eistanz, Vorsitz";

                repository.AddEntry<PersonRoleRelation>(walterRelation);
                repository.Save(walterRelation);
                #endregion

                #region Cécile Bossi
                Person cecile = new Person();
                cecile.FirstName = "Cécile";
                cecile.LastName = "Bossi";
                cecile.EMail = "info@eislaufscb.ch";

                PersonRoleRelation cecileRelation = new PersonRoleRelation();
                cecileRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.Secretary.ToString())).FirstOrDefault();
                cecileRelation.Person = cecile;
                cecile.AreaOfResponsibility = "";

                repository.AddEntry<PersonRoleRelation>(cecileRelation);
                repository.Save(cecileRelation);
                #endregion

                #region Brigitta Willi
                Person brigitta = new Person();
                brigitta.FirstName = "Brigitta";
                brigitta.LastName = "Willi";
                brigitta.EMail = "";

                PersonRoleRelation brigittaRelation = new PersonRoleRelation();
                brigittaRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.Cashier.ToString())).FirstOrDefault();
                brigittaRelation.Person = brigitta;
                brigitta.AreaOfResponsibility = "";

                repository.AddEntry<PersonRoleRelation>(brigittaRelation);
                repository.Save(brigittaRelation);
                #endregion

                #region Marie-Nicole Ostertag
                Person ostertag = new Person();
                ostertag.FirstName = "Marie";
                ostertag.MiddleName = "Nicole";
                ostertag.LastName = "Ostertag";
                ostertag.EMail = "";

                PersonRoleRelation ostertagRelation = new PersonRoleRelation();
                ostertagRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.TechnicalChiefIceSkating.ToString())).FirstOrDefault();
                ostertagRelation.Person = ostertag;
                ostertag.AreaOfResponsibility = "";

                repository.AddEntry<PersonRoleRelation>(ostertagRelation);
                repository.Save(ostertagRelation);
                #endregion

                #region Renata Wernli
                Person renata = new Person();
                renata.FirstName = "Renata";
                renata.LastName = "Wernli";
                renata.EMail = "renata.wernli@hotmail.com";

                PersonRoleRelation renataRelation = new PersonRoleRelation();
                renataRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.TechnicalChiefIceSkating.ToString())).FirstOrDefault();
                renataRelation.Person = renata;
                renata.AreaOfResponsibility = "Beisitz TK-Kunstlauf";

                repository.AddEntry<PersonRoleRelation>(renataRelation);
                repository.Save(renataRelation);

                #endregion

                #region Catrin Jähnig
                Person catrin = new Person();
                catrin.FirstName = "catrin";
                catrin.LastName = "Jähnig";
                catrin.EMail = "";

                PersonRoleRelation catrinRelation = new PersonRoleRelation();
                catrinRelation.PersonType = repository.GetAll<PersonType>().Where(type => type.Name.Contains(RoleTypeEnum.TechnicalChiefIceSkating.ToString())).FirstOrDefault();
                catrinRelation.Person = catrin;
                catrin.AreaOfResponsibility = "Beisitz TK-Kunstlauf";

                repository.AddEntry<PersonRoleRelation>(catrinRelation);
                repository.Save(catrinRelation);
                #endregion


            }
        }

        private void AddPhones(PersonRepository repository)
        {

            List<Person> contacts = repository.GetAll<Person>().Where(person => person.PersonRoleRelation.FirstOrDefault().PersonType.Name != "Skater").ToList();

            for (int index = 0; index < contacts.Count; index++)
            {
                if (contacts[index].FirstName == "Jürg" && contacts[index].LastName == "Burkhardt" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "061 421 15 41" };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Walter" && contacts[index].LastName == "Minder" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "032 351 52 52 " };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Cécile" && contacts[index].LastName == "Bossi" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 333 90 90" };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Brigitta" && contacts[index].LastName == "Willi" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 832 01 21" };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Marie" && contacts[index].LastName == "Ostertag" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 961 24 62" };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Renata" && contacts[index].LastName == "Wernli" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "" };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Catrin" && contacts[index].LastName == "Jähnig" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 839 95 20" };
                    contacts[index].Phone.Add(phone);

                    repository.Save(contacts[index]);
                }
                if (contacts[index].FirstName == "Christoph" && contacts[index].LastName == "Stämpfli" && contacts[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "031 751 30 81" };
                    Phone mobile = new Phone() { SubScriberNumber = "079 833 35 75" };
                    contacts[index].Phone.Add(phone);
                    contacts[index].Phone.Add(mobile);

                    repository.Save(contacts[index]);
                }
            }


            List<Person> trainers = repository.GetPersonByType("Trainer");

            for (int index = 0; index < trainers.Count; index++)
            {
                if (trainers[index].FirstName == "Jacqueline" && trainers[index].LastName == "Kiefer" && trainers[index].Phone.Count == 0)
                {
                    Phone phone = new Phone() { SubScriberNumber = "062 212 21 88" };
                    trainers[index].Phone.Add(phone);

                    repository.Save(trainers[index]);
                }
            }
        }
    }
}